<template>
	<view class="activity">
		<view class="activity-view" v-for="(item,index) in list" v-if="list.length > 0" @click="urlClick(item.id)">
			<view class="activity-view-title">{{item.name}}</view>
			<view class="activity-view-view">
				<view class="activity-view-view-1">适用范围：{{item.vipid_text}}</view>
				<view class="activity-view-view-2">发布时间：{{item.createtime_text}}</view>
			</view>
		</view>
		
		<view class="zan" v-if="list.length == 0">
			<image src="../../static/zan.png"></image>
			<view>暂无数据</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list :[]
			}
		},
		onLoad() {
			this.getall();
		},
		methods: {
			urlClick(e){
				uni.navigateTo({
					url:'/pages/activity/info?id='+e
				});
			},
			getall(){
				let that  = this;
				that.$api.activityall({}).then(res=>{
					that.list = res.data.list;
				})
				
			}
		}
	}
</script>

<style lang="less">
	.activity {
		width: 690rpx;
		margin: auto;
		.activity-view {
			border-bottom: 2rpx solid #e8e8e8;
			padding-bottom: 20rpx;
			padding-top: 20rpx;
			.activity-view-title {
				text-align: justify;
				font-size: 36rpx;
				padding-bottom: 30rpx;
			}
			.activity-view-view {
				font-size: 32rpx;
				display: flex;
				color:#8d8d8d;
				.activity-view-view-1 {
					flex: 1;
				}
				.activity-view-view-2 {
					flex: 1;
					text-align: right;
					
				}
			}
		}
	}
</style>
